<?php 
session_start();

if(strlen($_SESSION["u_name"])== 0)
{
 header("Location:index.php");
}
include_once 'conf/db-config.php'; 
include 'Classes/MyClass.php';
$objMyCass = new MyClass();
$userdetails = array();
$userdetails = $objMyCass->FetchUserRecords($_SESSION["user_id"]);
$userConsultingPackage =array();
$userConsultingPackage = $objMyCass->getConsultingPackage($_SESSION["user_id"]);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="js/jquery-1.4.2.js" type="text/javascript" language="javascript"></script>
<script src="js/ajax.js" type="text/javascript" language="javascript"></script>
<script src="js/tab-view.js" type="text/javascript" language="javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="css/tab-view.css" rel="stylesheet" type="text/css" />
<link href="cssbuttons.css" rel="stylesheet" type="text/css">
<link href="skins/sample/sample.css" rel="stylesheet" type="text/css">

<style type="text/css">
	body {
		margin: 20px;
		padding: 0px;
		font: 16px arial, sans-serif; }

	pre {text-indent: 30px}

	#tabmenu {
		color: #000;
		border-bottom: 2px solid #CDCDCD;
		margin: 12px 0px 0px 0px;
		padding: 0px;
		z-index: 1;
		padding-left: 10px }

	#tabmenu li {
		display: inline;
		overflow: hidden;
		list-style-type: none; }

	#tabmenu a, a.active {
		color: #DEDECF;
		background: #898B5E;
		font: bold 1em "Trebuchet MS", Arial, sans-serif;
		border: 1px solid #CDCDCD;
		padding: 2px 5px 0px 5px;
		margin: 0;
		text-decoration: none; }

	#tabmenu a.active {
		background: #ABAD85;
		border-bottom: 3px solid #ABAD85; }

	#tabmenu a:hover {
		color: #fff;
		background: #ADC09F; }

	#tabmenu a:visited {
		color: #E8E9BE; }

	#tabmenu a.active:hover {
		background: #ABAD85;
		color: #DEDECF; }

	#content {font: 0.9em/1.3em "bitstream vera sans", verdana, sans-serif;
		text-align: justify;
		background: #F6F7F8;
		padding: 20px;
		border: 1px solid #CDCDCD;
		border-top: none;
		z-index: 2;	}

	#content a {
		text-decoration: none;
		color: #E8E9BE; }

	#content a:hover { background: #898B5E; }
	</style>

</head>
<body>


<!-- container -->
<div id="container">
	<div class="center">
		<!-- header -->
		<div class="header">
			<div class="logo"><a href="#"><img src="images/logo.png" alt="" /></a></div>
			<div class="login">
				<div class="studentlogin">
					<!-- <h1>Student Login</h1>-->
					<div class="username">
						<!-- <p class="uname">Username:</p> -->
						<div class=""><!-- <input type="text" class="t_box" value="" /> --></div>
					</div>
					<div class="">
						<!-- <p class="uname">Password:</p> -->
						<div class=""><!-- <input type="password" class="t_box" value="" /> --></div>
					</div> 
					
				</div>
				
				<div class="logo1"><a href="#"><img src="images/logo1.png" alt="" /></a></div>
				<div style="text-align:right" >Welcome ,<?php print $_SESSION["u_name"];?>&nbsp;&nbsp;<a href="Logout.php">Log Out</a></div>
			</div>
			<div class="nav">
				<ul>
					<li><a href="Home.php" >Home</a></li>
					<li><a href="about-us.php">About Us</a></li>
					<li><a href="GmatPreparation.php">GMAT Preperation</a></li> 
					<li><a href="AdmissionConsulting.php">Admissions Consulting</a></li> 
					<li><a href="http://techbridge.co.in/forum/">MBA Forum</a></li> 
					<li><a href="contact-us.php">Contact Us</a></li>
				</ul>
			</div>
		</div>
		<!-- header -->
		<!-- middle -->

		<div class="middle">
			
			<form action="" method="post">
		<table cellpadding="1" cellspacing="0" width="400" style="margin-top:20px;margin-left:300px;border: 2px solid #20696A" > 
 	<tr height="35">
 		<td width="180" align="center">
 			<b><span style="color: #074772">Thank You for buying our resources</span></b>
 		</td>
 	</tr>
 	<tr>
 		<td colspan="2" width="180" style="padding-left: 80px;">
 		&nbsp;
 		</td>
 	</tr>
 	<tr height="35">
 		<td width="180" align="center">
 			<b><span style="color: #074772">You have successfully purchased the resources</span></b>
 		</td>
 	</tr>
 	<tr>
 		<td colspan="2" width="180" style="padding-left: 80px;">
 		&nbsp;
 		</td>
 	</tr>
 	<tr height="35">
 		<td width="180" align="center">
 			<b><span style="color: #074772">Your Transaction ID : <?php echo $final['txn_id']; ?></span></b>
 		</td>
 	</tr>
 	
 	</table>
 	</form>
		<?php 
	if ($_REQUEST['action'] == 'success') 
	{
		$buyamount  = $_SESSION['finalBookingPrice'];
		$sql ="";
		$userId = $_SESSION["user_id"];
		if(strlen($buyamount)>0)
		{
			$pack =$_SESSION['itemSelected'];
			$arrNumber = array();
			$arrNumber = explode("_",$pack);
			$sql = "INSERT INTO tbl_user_admission_package(user_id, package, is_active) VALUES ('".$userId."','$arrNumber[0]','N')";
			
			$string ="You have successfully bought a ".str_replace("_"," ",$_SESSION['itemSelected'])." .";
			$updateSql = "INSERT INTO tbl_recent_update (user_id, updates, updated_on, is_deleted) VALUES
			('".$userId."','".$string."',now(),'n')";
			
			//print $updateSql;
			
			mysql_query($updateSql);
			mysql_query($sql);
		}
	}
?>
		<div class="bar"><img src="images/ftopbg.png" alt=""/></div>
			
		</div>
		<!-- /middle -->
		<!-- footer -->
			<div class="footer" style="height: 15px;">
				<ul>
					<li><a href="#">Home</a></li>
					<li>|</li>
					<li><a href="#">About Us</a></li>
					<li>|</li>
					<li><a href="#">GMAT Preperation</a></li>
					<li>|</li>
					<li><a href="#">Admissions Consulting</a></li>
					<li>|</li>
					<li><a href="#">MBA Blog</a></li>
					<li>|</li>
					<li><a href="#">Contact Us</a></li>
				</ul>
			</div>
		<!-- /footer -->
	</div>
</div>
<!-- / container -->
 </body>
</html>